const express = require("express");
const path = require("path");
const bodyParser = require("body-parser");

let app = express();

app.get("/", (req, res) => {
  res.sendFile(path.join(__dirname, "./views/index.html"));
});
// app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.post("/postdata", async (req, res) => {
  console.log(req.body);
  res.json({ info: "成功", status: 1 });
});

app.listen(8989);
